<?php
session_start(); 
if(!isset($_SESSION['userName'])){
header( 'location:../../index.php' ); 
}
include("../../conf/connect.php");
	$user_id = $_SESSION['user_id'];
	$qus_no = $_GET['qus'];
	$hid= $_SESSION['usrHHid'];
	$bid = $_GET['bid'];
	$mmid = $_GET['mmid'];
	  
  if($qus_no =='upd1'){
    $serial = $_POST['qusNo'];
	$bid = $_POST['bid'];
	$resp_id=$_POST['resp_id'];
	header( "location: uqp1.php?serial=$serial&resp_id=$resp_id" );
  } 
  else if($qus_no =='upd2'){
    $serial = $_POST['qusNo'];
	$bid = $_POST['bid'];
	$resp_id=$_POST['resp_id'];
	header( "location: uqp2.php?serial=$serial&resp_id=$resp_id" );
  } 
  /*else if($qus_no =='upd2'){
    $serial = $_POST['qusNo'];
	$hid = $_POST['hhhid'];
	$bid = $_POST['bid'];
	header( "location: uqp3.php?serial=$serial&hid=$hid&bid=$bid" );
  } 
  else if($qus_no =='upd3'){
    $serial = $_POST['qusNo'];
	$hid = $_POST['hhhid'];
	$bid = $_POST['bid'];
	header( "location: uqp4.php?serial=$serial&hid=$hid&bid=$bid" );
  } */
  else if($qus_no =='emp01'){
	$name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	$sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_emp.php?resp_id=$resp_id&bid=1" );
  }
  else if($qus_no =='emp02'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_emp.php?resp_id=$resp_id&bid=1" );
  }
  else if($qus_no =='emp03'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_emp.php?resp_id=$resp_id&bid=1" );
  }
  else if($qus_no =='emp04_a'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_emp.php?resp_id=$resp_id&bid=1" );
  }
  else if($qus_no =='emp04_b'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_emp.php?resp_id=$resp_id&bid=1" );
  }
  else if($qus_no =='emp05'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_emp.php?resp_id=$resp_id&bid=1" );
  }
  else if($qus_no =='emp06'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_emp.php?resp_id=$resp_id&bid=1" );
  }
  else if($qus_no =='emp07'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_emp.php?resp_id=$resp_id&bid=1" );
  }
  else if($qus_no =='spn01_a'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	$sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn01_b'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn01_c'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn01_d'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn01_e'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn01_a'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }else if($qus_no =='spn01_a'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn02_a'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn02_b'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn02_c'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn02_d'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn02_e'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
 
  else if($qus_no =='spn03_a'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn03_b'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn03_c'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn03_d'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn03_e'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn04_a'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn04_b'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn04_c'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn04_d'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn04_e'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
 }
 else if($qus_no =='spn05_a'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn05_b'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn05_c'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn05_d'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn05_e'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
 }
 else if($qus_no =='spn06_a'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn06_b'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn06_c'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn06_d'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
  }
  else if($qus_no =='spn06_e'){
	 $name = $_POST['name'];
	$resp_id=$_GET['resp_id'];
	 $sql="Update adult_question set $qus_no = '$name' where user_id='$user_id' and hid='$hid' and resp_id='$resp_id'";
	mysql_query($sql) or die ("problem budget_heads");
	header( "location: update_spn.php?resp_id=$resp_id&bid=2" );
 }
  
  
  
?>